import { getCartCounts } from '@/network/cart'


const actions = {
    updateCart({commit,state}){
        getCartCounts().then(res => {
            let count = 0
            if(res.nums__sum > 0) {
                count = res.nums__sum
            }
            window.localStorage.setItem('count',count)
            commit('updateCartCount',{count})
        })
    }
}


export default actions